﻿// -----------------------------------------------------------------------
// <copyright file="PrivateCar.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex03.GarageLogic
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public enum eNumOfDoors
    {
        Two = 2,
        Three = 3,
        Four = 4,
        Five = 5
    }

    public enum eColor
    {
        Red = 1,
        Yellow = 2,
        Black = 3,
        Silver = 4
    }

    internal sealed class PrivateCar : Vehicle
    {
        private const int k_NumberOfTires = 4;
        private const float k_MaxAirPressure = 28f;
        private const float k_MaxFuelTankCapacity = 55f;
        private const float k_MaxBatteryLife = 2.5f;
        private const eTypeOfFuel k_TypeFuel = eTypeOfFuel.Octan98;
        private eNumOfDoors m_NumOfDoors;
        private eColor m_CarColor;

        internal PrivateCar(string i_Model, string i_PlateNum, List<Tire> i_Tires, EnergySource i_EnergySource, eColor i_CarColor, eNumOfDoors i_NumOfDoors)
        {
            this.ModulName = i_Model;
            this.LicensePlate = i_PlateNum;
            this.TireCollection = i_Tires;
            this.SourceOfEnergy = i_EnergySource;
            this.CalculatePercentEnergyLeft();
            this.m_CarColor = i_CarColor;
            this.m_NumOfDoors = i_NumOfDoors;
        }

        internal static int NumOfTires
        {
            get { return k_NumberOfTires; }
        }

        internal static float MaxAirPressure
        {
            get { return k_MaxAirPressure; }
        }

        internal static float MaxFuelTankCapacity
        {
            get { return k_MaxFuelTankCapacity; }
        }

        internal static float MaxBaterryLife 
        {
            get { return k_MaxBatteryLife; }
        }

        internal static eTypeOfFuel TypeFuel
        {
            get { return k_TypeFuel; }
        }

        internal eColor Color
        {
            get { return this.m_CarColor; }
        }

        internal eNumOfDoors NumberOfDoors
        {
            get { return this.m_NumOfDoors; }
        }

        internal override void GetVehicleData(ref StringBuilder o_VehicleData)
        {
            base.GetVehicleData(ref o_VehicleData);
            o_VehicleData.AppendFormat("{0}Car color: {1}{0}Number of doors: {2}{0}", Environment.NewLine, this.Color.ToString(), this.NumberOfDoors.ToString());
        }
    }
}
